<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>修仙传说 - 网页修仙游戏</title>
    <meta name="description" content="一款基于网页的修仙题材RPG游戏，体验从练气到飞升的修仙之路" />
    <style>
      /* 水墨风格背景 */
      body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
        background-attachment: fixed;
        min-height: 100vh;
      }
      
      /* 加载动画 */
      .loading-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        color: #f39c12;
      }
      
      .loading-text {
        font-size: 2rem;
        font-weight: bold;
        margin-bottom: 2rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
      }
      
      .loading-spinner {
        width: 60px;
        height: 60px;
        border: 4px solid rgba(243, 156, 18, 0.3);
        border-top: 4px solid #f39c12;
        border-radius: 50%;
        animation: spin 1s linear infinite;
      }
      
      @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
      }
      
      /* 隐藏加载界面 */
      .loading-hidden {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
      }
    </style>
  </head>
  <body>
    <!-- 加载界面 -->
    <div id="loading" class="loading-container">
      <div class="loading-text">修仙传说</div>
      <div class="loading-spinner"></div>
      <div style="margin-top: 1rem; font-size: 1rem; opacity: 0.8;">正在加载游戏世界...</div>
    </div>
    
    <!-- 游戏主容器 -->
    <div id="root"></div>
    
    <script type="module" src="/src/main.tsx"></script>
    
    <script>
      // 页面加载完成后隐藏加载界面
      window.addEventListener('load', () => {
        setTimeout(() => {
          const loading = document.getElementById('loading');
          if (loading) {
            loading.classList.add('loading-hidden');
            setTimeout(() => {
              loading.style.display = 'none';
            }, 500);
          }
        }, 1000);
      });
    </script>
  </body>
</html>